CompassTestCase = TestCase("CompassTestCase");

var compass = new Compass();

CompassTestCase.prototype.testRotateFromN = function() {
	var newDirection = null;

	newDirection = compass.rotateCW(DIRECTION.N, COMMAND.D);
	assertEquals(DIRECTION.E, newDirection);

	newDirection = compass.rotateCW(DIRECTION.N, COMMAND.G);
	assertEquals(DIRECTION.W, newDirection);

	newDirection = compass.rotateCW(DIRECTION.N, COMMAND.A);
	assertEquals(DIRECTION.N, newDirection);
};

CompassTestCase.prototype.testRotateFromE = function() {
	var newDirection = null;
	
	newDirection = compass.rotateCW(DIRECTION.E, COMMAND.D);
	assertEquals(DIRECTION.S, newDirection);
	
	newDirection = compass.rotateCW(DIRECTION.E, COMMAND.G);
	assertEquals(DIRECTION.N, newDirection);
	
	newDirection = compass.rotateCW(DIRECTION.E, COMMAND.A);
	assertEquals(DIRECTION.E, newDirection);	
};

CompassTestCase.prototype.testRotateFromS = function() {
	var newDirection = null;
	
	newDirection = compass.rotateCW(DIRECTION.S, COMMAND.D);
	assertEquals(DIRECTION.W, newDirection);
	
	newDirection = compass.rotateCW(DIRECTION.S, COMMAND.G);
	assertEquals(DIRECTION.E, newDirection);
	
	newDirection = compass.rotateCW(DIRECTION.S, COMMAND.A);
	assertEquals(DIRECTION.S, newDirection);
	
};

CompassTestCase.prototype.testRotateFromW = function() {
	var newDirection = null;
	
	newDirection = compass.rotateCW(DIRECTION.W, COMMAND.D);
	assertEquals(DIRECTION.N, newDirection);
	
	newDirection = compass.rotateCW(DIRECTION.W, COMMAND.G);
	assertEquals(DIRECTION.S, newDirection);
	
	newDirection = compass.rotateCW(DIRECTION.W, COMMAND.A);
	assertEquals(DIRECTION.W, newDirection);
};